<template>
  <div id="collectRoot">
    <div class="rightBox">
      <div class="btn_group">
        <button :class="{ active: input_btn == '1' }" @click="input_btn = '1'">达人收藏</button>
        <button :class="{ active: input_btn == '2' }" @click="input_btn = '2'">商品收藏</button>
        <button :class="{ active: input_btn == '3' }" @click="input_btn = '3'">视频收藏</button>
        <button :class="{ active: input_btn == '4' }" @click="input_btn = '4'">音乐收藏</button>
        <button :class="{ active: input_btn == '5' }" @click="input_btn = '5'">话题收藏</button>
      </div>
      <div class="rightBox-content">
        <TalentCollect v-if="input_btn == '1'" />
        <GoodsCollect v-if="input_btn == '2'" />
        <VideoCollect v-if="input_btn == '3'" />
        <MusicCollect v-if="input_btn == '4'" />
        <TopicCollect v-if="input_btn == '5'" />
      </div>
    </div>
  </div>
</template>

<script>
import TalentCollect from '@/pages/Li/myCollect/talentCollect.vue';
import GoodsCollect from '@/pages/Li/myCollect/goodsCollect.vue';
import VideoCollect from '@/pages/Li/myCollect/videoCollect.vue';
import MusicCollect from '@/pages/Li/myCollect/musicCollect.vue';
import TopicCollect from '@/pages/Li/myCollect/topicCollect.vue';

export default {
  props: {},
  data() {
    return {
      input_btn: '1'
    };
  },
  computed: {},
  created() {
    this.$nextTick(() => {
      document.title = '达人收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
    });
  },
  mounted() {},
  watch: {
    input_btn: function (newVal, oldVal) {
      if (newVal == '1') {
        this.input_btn = '1';
        document.title = '达人收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
      } else if (newVal == '2') {
        this.input_btn == '2';
        document.title = '商品收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
      } else if (newVal == '3') {
        this.input_btn == '3';
        document.title = '视频收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
      } else if (newVal == '4') {
        this.input_btn == '4';
        document.title = '音乐收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
      } else if (newVal == '5') {
        this.input_btn == '5';
        document.title = '话题收藏-直播电商数据分析&智能分析服务平台-掌上精选；';
      }
    }
  },
  methods: {},
  components: {
    TalentCollect,
    GoodsCollect,
    VideoCollect,
    MusicCollect,
    TopicCollect
  }
};
</script>

<style scoped lang="less">
#collectRoot {
  box-sizing: border-box;
  display: flex;
  min-height: 80vh;
  margin-top: @margin-num;
  margin-left: @margin-num;
  margin-right: @margin-num;
  background-color: #f1f1f1;

  .rightBox {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    height: 100%;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    border-radius: 6px;
    .btn_group {
      text-align: left;
      .active {
        background-color: #fd7f2c;
        color: #ffffff !important;
      }
      button {
        font-size: 14px;
        color: #555;
        padding-left: 22px;
        padding-right: 22px;
        height: 40px;
        background-color: #fff;
        border-radius: 4px;
        margin-right: 7px;
        font-weight: 600;
      }
      button:hover {
        color: #ff924b;
      }
    }
  }
  .rightBox-content {
    background-color: #ffffff;
    border-radius: 6px;
    margin-top: 10px;
  }
}
</style>
